﻿using System;

namespace Books.Model
{
    public class AuthorModel
    {
        public int AuthorId { get; set; }
        public int BookCount { get; set; }
        public Nullable<DateTime> Born { get; set; }
        public Nullable<DateTime> Died { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }

        public virtual BookModel[] Books { get; set; }
        public virtual PublisherModel[] Publishers { get; set; }

        public string GetFullName()
        {
            return
                (String.IsNullOrEmpty(FirstName) ? "" : FirstName + " ") +
                LastName;
        }
    }
}
